<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
		<title>ptemplatejs demo</title>
		<script src="ptemplate.js"></script>
		<script src="ptemplate.extend.tmplattrs.js"></script>
		<script src="ptemplate.extend.tmplfilter.js"></script>
		<script src="ptemplate.extend.jsonp.js"></script>
		<script src="ptemplate.extend.ajax.js"></script>
		<script src="ptemplate.extend.touchs.js"></script>
		<script src="ptemplate.extend.animate.js"></script>
		<style>
			body {
				background: #f4f5f7;
				font-family: 微软雅黑;
			}
			body, ul, p {
				list-style: none;
				padding: 0;
				margin: 0;
			}
			.pstyle{
				font-size:1rem;
				color:rgb(255,69,0);
			}
			.box{width:200px;height:100px;background-color:rgb(0,0,0);}
		</style>
	</head>
	<body>
		<div class="box"></div>
		<button class="stop">Stop</button>
		<script>
			(function(win, $){
				$.setBaseFontSize(16);
				$.animate($.query(".box")[0], {
					width: 100,
					height: 50,
					opacity: 0
				}, 500, function(){
					var ani = $.animate($.query(".box")[0], {
						width: 200,
						height: 100,
						opacity: 1
					}, 1500, function(){
						console.log("animate end")
					});
					$.query(".stop")[0]._on("click", function(e){
						ani.delay(2000);
					});
				});
			})(this, pTemplate);
		</script>
	</body>
</html>